package com.hjl.sr.security.token;

import com.hjl.sr.remoting.EncryptContext;
import com.hjl.sr.security.SecurityUtil;

public class ClientTokenManager implements TokenManager {

	private TokenService tokenService;

	public ClientTokenManager(TokenService tokenService) {
		this.tokenService = tokenService;
	}

	public String getEncryptToken(EncryptContext encryptContext) {
		String token = tokenService.getToken();
		encryptContext.addHeader(SecurityUtil.TOKEN_HEADER_NAME, token);
		return token;
	}

	public String getDecryptToken(EncryptContext encryptContext) {
		return null;
	}

	public void clearToken(EncryptContext encryptContext, String token) {
		
	}

}
